
fn main()
{
    
    //str 在堆中
    let str1 = String::from("haha");
    let str2 = str1;
    //在栈中，move时拷贝
    let a = 5;
    let b = a;
    
    //复制方式
    let str3 = str2.clone();

    //引用
    let str4 = &str3;
    
    //println!("{}", str1); error move to str2
    println!("{} {}", a, str2);
    println!("{} {} {}", str3, str2, str3);


}


